package com.huanzhidadi.java8inaction.predicate.impl;

import com.huanzhidadi.java8inaction.model.Apple;
import com.huanzhidadi.java8inaction.predicate.ApplePredicate;

/**
 * 对红色和重量进行筛选
 */
public class AppleRedAndHeavyPredicate implements ApplePredicate {
    @Override
    public boolean test(Apple apple) {
        return "red".equals(apple.getColor())
                && apple.getWeight() > 120;
    }
}
